package com.example.shushiyunsst.fragment.main.home.child.miner.sub

import android.os.Bundle
import android.view.View
import com.example.library_common.base.BaseFragmentEx
import com.example.shushiyunsst.R
import com.example.shushiyunsst.widget.water_view.FloatBallView
import com.example.shushiyunsst.widget.water_view.model.FloatBall
import com.senon.modularapp.util.JssSpannableString

class MinerPoolHeaderFragment : BaseFragmentEx() {

    companion object {
        fun newInstance(): MinerPoolHeaderFragment {
            val args = Bundle()
            val fragment = MinerPoolHeaderFragment()
            fragment.arguments = args
            return fragment
        }
    }


    private lateinit var mWaterView: FloatBallView

    private var waters = mutableListOf<FloatBall>()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mSuperBackPressedSupport=false
    }

    override fun getLayoutId() = R.layout.miner_pool_header_fragment


    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        mWaterView=view.findViewById(R.id.mWaterView)
        val str0 = "已产出矿石"
        val str1 = "20000"
        val unit = "枚"
        waters.add(
            FloatBall(
                JssSpannableString(_mActivity, "$str0\n$str1$unit")
                    .first(str0)
                    .textColor(R.color.tab_text_normal)
                    .size(14)
                    .first(str1)
                    .textColor(R.color.tab_text_normal)
                    .size(14)
                    .first(unit)
                    .textColor(R.color.tab_text_normal)
                    .size(8)
            )
        )

        val str3 = "待产出矿石"
        val str4 = "70000"

        waters.add(
            FloatBall(
                JssSpannableString(_mActivity, "$str3\n$str4$unit")
                    .first(str3)
                    .textColor(R.color.tab_text_normal)
                    .size(14)
                    .first(str4)
                    .textColor(R.color.tab_text_normal)
                    .size(14)
                    .first(unit)
                    .textColor(R.color.tab_text_normal)
                    .size(8)
            )
        )

        mWaterView.setDatas(waters)

    }


}